package com.gm.wholesale.module.voice.model;

import android.util.ArrayMap;

import com.gm.commonlib.base.baseBean.DataResp;
import com.gm.commonlib.base.baseView.IBaseView;
import com.gm.commonlib.network.BaseHttpObserver;
import com.gm.commonlib.network.HttpClient;
import com.gm.commonlib.network.HttpServicesHolder;
import com.gm.wholesale.module.voice.api.IVoiceApi;
import com.gm.wholesale.module.voice.bean.VoiceGetGoodBean;

import io.reactivex.Observable;

public class VoiceModel {

    public static void getGoodByVoice(IBaseView iBaseView,
                                      ArrayMap<String, Object> data,
                                      BaseHttpObserver<DataResp<VoiceGetGoodBean>> observer) {
        HttpClient.sendRequest(iBaseView, new HttpServicesHolder<IVoiceApi, DataResp<VoiceGetGoodBean>>() {
            @Override
            public Observable<DataResp<VoiceGetGoodBean>> getHttpObservable(IVoiceApi instance) {
                return instance.getGoodByVoice(data);
            }
        }, observer);
    }
}
